<extend name="edit"/>
<block name="pageFooter">
    <div class="bjui-pageFooter">
        <ul style="float: left;">
            <li><button type="button" class="btn-blue" id="preview">预览</button></li>
        </ul>
        <ul>
            <li><button type="button" class="btn-close">关闭</button></li>
            <li><button type="submit" class="btn-default">保存</button></li>
        </ul>
    </div>
</block>
<block name="pageJavascript">
    <script>

        /**
         * 预览按钮
         */
        $.CurrentNavtab.find("#preview").click(function () {
            var data = $.CurrentNavtab.find(".pageForm").serializeArray();
            console.log(data);
            var url = "{:U('ajaxPreviewSave')}";
            $.ajax({
                type: "POST",
                url: url,
                data: data,
                async: false,
                dataType: "json",
                success: function (result) {
                    console.log(result);
                    if (result && result.statusCode == 200) {
                        var options = {};
                        options['id'] = "preview";
                        options['width'] = "395";
                        options['height'] = "795";
                        options['url'] = "{:U('previewDisplay')}";
                        options['title'] = "文章预览";
                        options['mask'] = true;
                        $(this).dialog(options);
                    }
                }
            });
        });

    </script>
</block>